#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 100010;
int n, cnt;
int primes[N];
bool st[N];
void get_primes()
{
    for (int i = 2; i <= n + 1; i++)
    {
        if (!st[i]) primes[cnt++] = i;
        for (int j = 0; primes[j] * i <= n + 1; j++)
        {
            st[primes[j] * i] = true;
            if (i % primes[j] == 0) break;
        }
    }
}
int main()
{
    cin >> n;
    get_primes();
    if (n <= 2) cout << 1 << endl;
    else cout << 2 << endl;
    for (int i = 2; i <= n + 1; i++)
    {
        if (st[i]) cout << 2 << " ";
        else cout << 1 << " ";
    }
    return 0;
}